package com.wss.common.bean;

import com.felipecsl.asymmetricgridview.AsymmetricItem;
import com.wss.common.base.bean.BaseBean;
import com.wss.common.constants.Constants;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
import ohos.utils.Parcel;

/**
 * Describe：可跳转的模板
 * Created by 吴天强 on 2018/11/13.
 */
@Getter
@Setter
public class Template extends BaseBean implements AsymmetricItem{

    private String title;
    private int res;
    private String describe;
    private Class clazz;
    /**
     * 模块外跳转链接
     */
    private String url;
    /**
     * 页面跳转类型
     */
    private int type;
    /**
     * 其他附加参数
     */
    private Map<String, ?> params;

    public Template(String title, String url, int type, String describe) {
        this.title = title;
        this.url = url;
        this.type = type;
        this.describe = describe;
    }

    public Template(String title, Class clazz, String describe) {
        this.title = title;
        this.clazz = clazz;
        this.type = Constants.TemplateType.ACTIVITY;
        this.describe = describe;
    }

    public Template(String title, int res, Class clazz) {
        this.title = title;
        this.res = res;
        this.clazz = clazz;
    }

    public String getTitle() {
        return title;
    }

    public int getRes() {
        return res;
    }

    public String getDescribe() {
        return describe;
    }

    public Class getClazz() {
        return clazz;
    }

    public String getUrl() {
        return url;
    }

    public int getType() {
        return type;
    }

    public Map<String, ?> getParams() {
        return params;
    }

    @Override
    public int getColumnSpan() {
        return 1;
    }

    @Override
    public int getRowSpan() {
        return 1;
    }

    @Override
    public boolean marshalling(Parcel parcel) {
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        return true;
    }
}
